/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package bean;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Redação_RádioPérola
 */
@Entity
@Table(name = "PRODUTO")
@NamedQueries({
    @NamedQuery(name = "Produto.findAll", query = "SELECT p FROM Produto p")})
public class Produto implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "PRO_COD")
    private Integer proCod;
    @Column(name = "PRO_DES")
    private String proDes;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Column(name = "PRO_PRE")
    private Double proPre;
    @Column(name = "PRO_CUS")
    private Double proCus;
    @Column(name = "PRO_MAR")
    private Double proMar;
    @Column(name = "PRO_GRA")
    private String proGra;
    @Column(name = "PRO_BAR")
    private String proBar;
    @Column(name = "PRO_UNI")
    private String proUni;
    @Column(name = "PRO_PES")
    private Double proPes;
    @Column(name = "PRO_REF")
    private String proRef;
    @Column(name = "PRO_VEN")
    private Character proVen;
    @Column(name = "PRO_CHK")
    private Short proChk;
    @Column(name = "PRO_OBS")
    private String proObs;
    @JoinColumn(name = "PRO_GRU", referencedColumnName = "GRU_COD")
    @ManyToOne
    private Grupo grupo;
    @JoinColumn(name = "PRO_FOR", referencedColumnName = "CLI_COD")
    @ManyToOne
    private Cliente cliente;

    public Produto() {
    }

    public Produto(Integer proCod) {
        this.proCod = proCod;
    }

    public Integer getProCod() {
        return proCod;
    }

    public void setProCod(Integer proCod) {
        this.proCod = proCod;
    }

    public String getProDes() {
        return proDes;
    }

    public void setProDes(String proDes) {
        this.proDes = proDes;
    }

    public Double getProPre() {
        return proPre;
    }

    public void setProPre(Double proPre) {
        this.proPre = proPre;
    }

    public Double getProCus() {
        return proCus;
    }

    public void setProCus(Double proCus) {
        this.proCus = proCus;
    }

    public Double getProMar() {
        return proMar;
    }

    public void setProMar(Double proMar) {
        this.proMar = proMar;
    }

    public String getProGra() {
        return proGra;
    }

    public void setProGra(String proGra) {
        this.proGra = proGra;
    }

    public String getProBar() {
        return proBar;
    }

    public void setProBar(String proBar) {
        this.proBar = proBar;
    }

    public String getProUni() {
        return proUni;
    }

    public void setProUni(String proUni) {
        this.proUni = proUni;
    }

    public Double getProPes() {
        return proPes;
    }

    public void setProPes(Double proPes) {
        this.proPes = proPes;
    }

    public String getProRef() {
        return proRef;
    }

    public void setProRef(String proRef) {
        this.proRef = proRef;
    }

    public Character getProVen() {
        return proVen;
    }

    public void setProVen(Character proVen) {
        this.proVen = proVen;
    }

    public Short getProChk() {
        return proChk;
    }

    public void setProChk(Short proChk) {
        this.proChk = proChk;
    }

    public String getProObs() {
        return proObs;
    }

    public void setProObs(String proObs) {
        this.proObs = proObs;
    }

    public Grupo getGrupo() {
        return grupo;
    }

    public void setGrupo(Grupo grupo) {
        this.grupo = grupo;
    }

    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (proCod != null ? proCod.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Produto)) {
            return false;
        }
        Produto other = (Produto) object;
        if ((this.proCod == null && other.proCod != null) || (this.proCod != null && !this.proCod.equals(other.proCod))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "bean.Produto[ proCod=" + proCod + " ]";
    }
    
}
